package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

@Getter
@Setter
public class Notice {
    private Long id;
    private Employee issuer;
    private Date pubdate;
    private String title;
    private String content;
    private Long readId;
    public boolean getReadIdName() {
      return readId == null;
    }

    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("pubdate",pubdate);
        map.put("title",title);
        map.put("content",content);
        if(issuer!=null){
            map.put("issuerId",issuer.getId());
        }
        return JSON.toJSONString(map);
    }


}